# Contributor: TBK <alpine@jjtc.eu>
# Maintainer: TBK <alpine@jjtc.eu>
pkgname=faudio
pkgver=24.04
pkgrel=0
pkgdesc="Accuracy-focused XAudio reimplementation for open platforms"
url="https://fna-xna.github.io/"
arch="all"
license="Zlib"
makedepends="cmake samurai sdl2-dev"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/FNA-XNA/FAudio/archive/$pkgver.tar.gz"
builddir="$srcdir/FAudio-$pkgver"

build() {
	cmake -G Ninja -B build \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=1 \
		-DBUILD_TESTS=1
	cmake --build build
}

check() {
	cd build
	./faudio_tests
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
6eec9274dffa0a03d072cf3f0a62dd1788474cfcfcb78036807a1196bba88bfd31969d637ce3577387ef411035352235d94c865c696268b0d7bfa0bd27221651  faudio-24.04.tar.gz
"
